package com.ruoyi.zsyh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zsyh.mapper.ZsyhUserCooperationMapper;
import com.ruoyi.zsyh.domain.ZsyhUserCooperation;
import com.ruoyi.zsyh.service.IZsyhUserCooperationService;
import com.ruoyi.common.core.text.Convert;

/**
 * 合作申请Service业务层处理
 * 
 * @author yuexl
 * @date 2022-02-25
 */
@Service
public class ZsyhUserCooperationServiceImpl implements IZsyhUserCooperationService 
{
    @Autowired
    private ZsyhUserCooperationMapper zsyhUserCooperationMapper;

    /**
     * 查询合作申请
     * 
     * @param id 合作申请ID
     * @return 合作申请
     */
    @Override
    public ZsyhUserCooperation selectZsyhUserCooperationById(String id)
    {
        return zsyhUserCooperationMapper.selectZsyhUserCooperationById(id);
    }

    /**
     * 查询合作申请列表
     * 
     * @param zsyhUserCooperation 合作申请
     * @return 合作申请
     */
    @Override
    public List<ZsyhUserCooperation> selectZsyhUserCooperationList(ZsyhUserCooperation zsyhUserCooperation)
    {
        return zsyhUserCooperationMapper.selectZsyhUserCooperationList(zsyhUserCooperation);
    }

    /**
     * 新增合作申请
     * 
     * @param zsyhUserCooperation 合作申请
     * @return 结果
     */
    @Override
    public int insertZsyhUserCooperation(ZsyhUserCooperation zsyhUserCooperation)
    {
        zsyhUserCooperation.setCreateTime(DateUtils.getNowDate());
        return zsyhUserCooperationMapper.insertZsyhUserCooperation(zsyhUserCooperation);
    }

    /**
     * 修改合作申请
     * 
     * @param zsyhUserCooperation 合作申请
     * @return 结果
     */
    @Override
    public int updateZsyhUserCooperation(ZsyhUserCooperation zsyhUserCooperation)
    {
        zsyhUserCooperation.setUpdateTime(DateUtils.getNowDate());
        return zsyhUserCooperationMapper.updateZsyhUserCooperation(zsyhUserCooperation);
    }

    /**
     * 删除合作申请对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteZsyhUserCooperationByIds(String ids)
    {
        return zsyhUserCooperationMapper.deleteZsyhUserCooperationByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除合作申请信息
     * 
     * @param id 合作申请ID
     * @return 结果
     */
    @Override
    public int deleteZsyhUserCooperationById(String id)
    {
        return zsyhUserCooperationMapper.deleteZsyhUserCooperationById(id);
    }
}
